package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.PublishWorkIn;
import com.gzh.teaching.service.dto.SaveJobIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

/**
 * @Author guanzh
 * @Date 2022/1/26 14:22
 * @Description
 */
@Setter
@Getter
@ToString
public class PublishWorkParam {
    @NotNull(message = "作业ID为空")
    private String workId;
    private String publishDate;
    private String publishTime;
    private String endDate;
    private String endTime;
    private String isEnd;

    public PublishWorkIn paramToIn(Integer userId) {
        PublishWorkIn in = new PublishWorkIn();
        in.setWorkId(NumericHelper.toInteger(this.workId));
        in.setPublishDate(NumericHelper.toInteger(this.publishDate));
        in.setPublishTime(NumericHelper.toInteger(this.publishTime));
        in.setEndDate(NumericHelper.toInteger(this.endDate));
        in.setEndTime(NumericHelper.toInteger(this.endTime));
        in.setIsEnd(NumericHelper.toInteger(this.isEnd));
        in.setUserId(userId);
        return in;
    }
}
